package it.traveldream.beans;

import it.traveldream.dto.DepartureDTO;
import it.traveldream.dto.LocationDTO;
import it.traveldream.dto.TransportMeanDTO;
import it.traveldream.exceptions.InvalidProductException;
import it.traveldream.exceptions.LocationNotFoundException;

import java.util.List;

/**
 * 
 * @author Flavio Ferrara
 * @see ProductManagerInterface
 *
 */
public interface TransportMeanManagerInterface extends
		ProductManagerInterface<TransportMeanDTO> {

	/**
	 * Returns a list containing the existing types of transport means. 
	 * @return List of mean types
	 */
	public List<String> getMeanTypes();
	
	/**
	 * Extension with respect to ProductManagerInterface.saveProduct
	 * For the first entered mean of a certain type to a location,
	 * this method will create the comingback mean, as well
	 * 
	 * Restriction with respect to ProductManagerInterface.saveProduct
	 * InvalidProductException will be thrown when trying to 
	 * save a comingback mean 
	 */
	@Override
	public TransportMeanDTO saveProduct(TransportMeanDTO product) throws InvalidProductException;
	
	/**
	 * Returns a list containing products of type TransportMean, located in the 
	 * specific location passed as argument.
	 * @param location The location to be searched for.
	 * @return List of transport mean items. 
	 * @throws LocationNotFoundException
	 */
	public List<TransportMeanDTO> getMeansByLocation(LocationDTO location) throws LocationNotFoundException;
	
	/**
	 * Returns a list containing all existing departures.
	 * @return List of departure
	 */
	public List<DepartureDTO> getDepartures();
	
	/**
	 * Returns a list containing all existing locations.
	 * @return List of location
	 */
	public List<LocationDTO> getLocations();
}
